#include "ejitemset.h"

#include <QGridLayout>
#include <QHBoxLayout>
#include <QGroupBox>
#include <QStandardItemModel>
#include <QCheckBox>

EJItemSet::EJItemSet(QWidget *parent) : QMainWindow(parent)
{
    auto central =  new QWidget();
    this->setCentralWidget(central);

    auto hlayout = new QHBoxLayout();

    auto typeGroup = new QGroupBox(tr("道具类型")); /*道具类型设定*/
    auto setGroup = new QGroupBox(tr("道具设置"));  /*道具设定*/

    hlayout->addWidget(typeGroup, 1);
    hlayout->addWidget(setGroup, 1);

    auto gridLayout = new QGridLayout();

    m_itemType = new QTableView();
    m_itemAttr = new QTableView();

    m_hasAttr  = new QCheckBox(tr("拥有属性"));

    m_typeModel = new QSqlTableModel();
    //m_attrModel = new QSqlTableModel();

    m_typeModel->setTable(tr("itemtype"));
    //m_attrModel->setTable(tr("itemattr"));

    gridLayout->addWidget(m_itemType, 0, 0, 15, 1);
    gridLayout->addWidget(m_hasAttr, 0, 1, 1, 1);
    //gridLayout->addWidget(m_itemAttr,0, 2, 15, 1);

    auto group = new QGroupBox(tr("请选择道具属性"));







    gridLayout->setColumnStretch(0, 1);
    gridLayout->setColumnStretch(1, 1);
    gridLayout->setColumnStretch(2, 2);

    typeGroup->setLayout(gridLayout);


    central->setLayout(hlayout);
}
